import { testFetch } from '@/pages/PageIndex/PageIndex';
import { message } from 'antd';
import { history } from 'umi';

export const render = async (oldRender) => {
  const res = await testFetch();
  if (res.code !== 200) {
    message.error(res.message);
    history.push('/login');
  }
  // 权限校验业务
  oldRender(); // 至少需要被调用一次
};
